package zl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zl.bean.provinceDO;
import zl.common.Common;
import zl.service.provinceService;

@RestController
public class ProvinceController {
	@Autowired
	provinceService ProvinceDao;
	
	@RequestMapping("/getOne")
	public String demo(){
		provinceDO ProvinceDO = new provinceDO();
		ProvinceDO.setId(1L);
		ProvinceDO.setShardValue(Common.DB_0);
		ProvinceDO = ProvinceDao.get(ProvinceDO);
		return ProvinceDO.getName();
	}
	@RequestMapping("/ByLocalGetOne")
	public String demo2(Long Id){
		provinceDO ProvinceDO = new provinceDO();
		ProvinceDO.setId(1L);
		ProvinceDO.setShardValue(Common.DB_1);
		ProvinceDO = ProvinceDao.get(ProvinceDO);
		return ProvinceDO.getName();
	}
}
